SELECT * FROM GCCOMPET;
select * from emploi;
select * from poste;
select * from perso P
         inner join emploi E 
         on P.CODEMP = E.codemp ;
select * from postpla PLA
         inner join perso P
         on pla.matricule = P.matricule
          inner join emploi E 
         on P.CODEMP = E.codemp
        ;
select a.matricule,libressource1,libressource2,datpla,plage,a.typjrs,a.hrsdeb,a.hrsfin,a.codposte,libposte,b.col01 
FROM postpla a, poste b, rcressource c 
where a.matricule=c.matricule 
and a.codposte=b.codposte and col01 = 'GM' 
and datpla = to_date('2013-11-06', 'YYYY-MM-DD') 
and codposte <> ' SITE' and a.matricule 
not in (select distinct (matricule) from tbabsenc abs 
WHERE abs.datdeb <= to_date('2013-11-06', 'YYYY-MM-DD') 
and abs.datfin >= to_date('2013-11-06','YYYY-MM-DD')) 
order by libposte,plage,matricule;

select a.matricule,libressource1,libressource2,datpla,plage,a.typjrs,a.hrsdeb,a.hrsfin,a.codposte,libposte,b.col01 
FROM postpla a, poste b, rcressource c 
where a.matricule=c.matricule 
and a.codposte=b.codposte and col01 = 'GM' 
and a.codposte = 'CMFGM' ; 

select rcressource.matricule, max(datent), rcressource.libressource1, rcressource.libressource2 from rcmouvnt INNER JOIN rcressource ON rcmouvnt.matricule = rcressource.matricule where datout > '19/11/13' AND (rcressource.matricule = '03176' OR rcressource.matricule = '03178') group by rcressource.matricule, rcressource.libressource1, rcressource.libressource2;
SELECT libval FROM rcressource A INNER JOIN rcvalzon B on A.matricule = B.matricule INNER JOIN rclisval C on B.valeur = C.codval WHERE B.zone_id = '2011101062569459877986043' AND A.matricule = '03176' ORDER BY datdeb desc; 

select distinct(abs.matricule), abs.codabs, poste.libposte, col01, sal.libressource1, sal.libressource2, abs.datdeb, abs.datfin from tbabsenc abs inner join rcressource sal on abs.matricule = sal.matricule left join postpla post on post.matricule = abs.matricule inner join poste poste on poste.codposte = post.codposte WHERE abs.datdeb <= to_date('2013-11-21', 'YYYY-MM-DD') and datfin >= to_date('2013-11-21','YYYY-MM-DD') and col01 = 'GM';
select * from tbabsenc abs inner join postpla post on post.matricule = abs.matricule WHERE abs.datdeb = to_date('2013-11-21', 'YYYY-MM-DD');


select a.matricule,libressource1,libressource2,datpla,plage,a.typjrs,a.hrsdeb,a.hrsfin,a.codposte,libposte,b.col01 FROM postpla a, poste b, rcressource c where a.matricule=c.matricule and a.codposte=b.codposte and col01 = 'ADS-RMPV' and datpla = to_date('2014-04-25', 'YYYY-MM-DD') and libposte <> 'RESPONSABLE SITE' and a.matricule not in (select distinct (matricule) from tbabsenc abs WHERE abs.datdeb <= to_date('2014-04-25', 'YYYY-MM-DD') and abs.datfin >= to_date('2014-04-25','YYYY-MM-DD')) and a.matricule <> '01483' order by libposte,plage,matricule